package com.heima.Controller;

import com.heima.Serivce.MongoService;
import com.heima.model.ES.Dotos.HistorySearchDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/history")
public class MongoController {
    @Autowired
    MongoService mongoService;

    @PostMapping("/load")
    public ResponseResult gethistory()
    {
        return mongoService.GetSelectHistory();
    }

    @PostMapping("/del")
    public ResponseResult DeleteById(@RequestBody HistorySearchDto historySearchDto)
    {
        return mongoService.DeleteById(historySearchDto);
    }

}
